<!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
<stack>
<name>in</name>
<id>-1</id>
<cardCount>20</cardCount>
<cardID>2944</cardID>
<listID>2093</listID>
<cantModify><false /></cantModify>
<cantDelete><false /></cantDelete>
<cantAbort><false /></cantAbort>
<cardSize>
<width>512</width>
<height>342</height>
</cardSize>
<script>on idleset lockscreen to falseend idlefunction getLine fileName-- read one line from the fileread from file fileName until returnput it into msgreturn (it)end getLinefunction terminator thisLine-- is thisLine a message terminator?global terminatorsif char 1 to 5 of thisLine is "Topic" and char 10 of thisLine is ":" ¬then return truerepeat with i = 1 to number of lines in terminatorsif line i of terminators is in thisLine then return trueend repeatreturn falseend terminatorfunction getNum thisLine-- crack the leading number from a contents lineput offset(":", thisLine) into endHerereturn value(char 1 to endHere - 1 of thisLine)end getNumfunction insertLine theField,thisNum,thisLine-- figure out where the new line should go in contents-- blank contents?if bkgnd field theField is empty thenput thisLine into bkgnd field theFieldreturn 1end if-- at end? (the most common case - checked first)if getNum(last line of bkgnd field theField) < thisNum thenput thisLine after bkgnd field theFieldreturn number of lines in bkgnd field theFieldend if-- all right, do it the hard wayrepeat with i = 1 to number of lines in bkgnd field theFieldif thisNum < getNum(line i of bkgnd field theField) thenput thisLine before line i of bkgnd field theFieldreturn iend ifend repeatend insertLineon addText newText-- concatenate to global text object, observing size limitglobal theText, textLengthadd length(newText) to textLengthif textLength > 29990 then exit addTextput newText after theTextend addTextfunction slurpText fileName,discard,putHere-- skip null lines, build message, paste into card-- return terminating line for analysisglobal theText, textLengthrepeat discardput getline(fileName) into fooend repeatput empty into theTextput 0 into textLengthrepeat-- pull in the message text-- done offscreen for performance reasons (no redraws)put getLine(fileName) into theLineif terminator(theLine) then exit repeataddText theLineend repeatput theText into bkgnd field putHerereturn theLineend slurpTexton setID topicID,idLine-- put id of this card into hidden link field of topic header cardif idLine is 0 then exit setIDget the id of this cardput it into line idLine of field "theLinks" of card id (word 3 of topicID)end setIDon import-- don't try to understand the details without a WELL transcript!global terminatorsask "Please enter name of text file:"if it is empty then exit importput it into fileNameopen file fileNameput "Interrupt!" & return & "(r)espond" & return & "responses total."¬into terminatorsrepeatput getLine(fileName) into theLineif theLine is empty then exit repeatrepeat while char 1 to 5 of theLine is "Topic" ¬and char 10 of theLine is ":"delete last char of theLinedelete char 11 of theLinedelete char 1 to 5 of theLineput getNum(theLine) into topicNumput topicNum into char 1 to 4 of theLineif theLine is not in field "theTopics" of card "Conference" then-- There is no Topic line in the Conference cardgo to card "Conference"put char 1 to 65 of theLine & return into theLineput insertLine("theTopics", topicNum, theLine) into fooend ifput theLine into topicLinego to card ("Topic" & topicNum) of bkgnd "Topic"if the result is not empty then-- There is no Topic header card for this topicgo to card 1 of bkgnd "Topic"doMenu Copy Cardgo to last carddoMenu Paste Cardset the name of this card to "Topic" & topicNumput theLine into bkgnd field "theTopic"-- read author lineput getLine(fileName) into theLineif char 1 to 4 of theLine is "By: " then-- This is originator's messagedelete char 1 to 4 of theLineput offset("